package rladidxo.basic;

import java.util.Scanner;

public class J08_65 {
public static void main(String[] args) {
	int w=1;
	System.out.println("[ 극장 예약 시스템 ]");
	
		System.out.println("현재 예약 상태는 다음과 같습니다.");
		Scanner sc = new Scanner(System.in);
		
		int num[];
		char movie[];
		int no[];
		int num1;
		num = new int[10];
		movie = new char[11];
		no = new int[10];
		for(int i=1;i<11;i++){movie[i] = '0';}
		movie[0] = 'A';
		if(movie[0]!='0'){while(movie[0]!='0'){
	
		System.out.println("----------------------------------------------------------------------------");
		for(int i=1; i<num.length+1; i++){num[i-1]=i; System.out.print(num[i-1]+"\t");}System.out.println();
		System.out.println("----------------------------------------------------------------------------");
		for(int i=0; i<10;i++){System.out.print(movie[i+1]+"\t");}System.out.println();
		System.out.println("----------------------------------------------------------------------------");
		System.out.print("좌석을 예약하세요, 취소하려면 같은 번호를 입력하세요[0:종료]:");
		num1 = sc.nextInt();
		switch(num1)
		{
		case 0:movie[0]='0';break;
		case 1:if(movie[1]=='0'){movie[1]='X';}else{movie[1]='0';};break;
		case 2:if(movie[2]=='0'){movie[2]='X';}else{movie[2]='0';};break;
		case 3:if(movie[3]=='0'){movie[3]='X';}else{movie[3]='0';};break;
		case 4:if(movie[4]=='0'){movie[4]='X';}else{movie[4]='0';};break;
		case 5:if(movie[5]=='0'){movie[5]='X';}else{movie[5]='0';};break;
		case 6:if(movie[6]=='0'){movie[6]='X';}else{movie[6]='0';};break;
		case 7:if(movie[7]=='0'){movie[7]='X';}else{movie[7]='0';};break;
		case 8:if(movie[8]=='0'){movie[8]='X';}else{movie[8]='0';};break;
		case 9:if(movie[9]=='0'){movie[9]='X';}else{movie[9]='0';};break;
		case 10:if(movie[10]=='0'){movie[10]='X';}else{movie[10]='0';};break;
		default:System.out.println("0~10의 숫자로 입력해주세요!!");
		}
/*		switch(num1)
		{
		case 0:movie[0]='0';break;
		case 1:movie[1]='X';;break;
		case 2:movie[2]='X';break;
		case 3:movie[3]='X';break;
		case 4:movie[4]='X';break;
		case 5:movie[5]='X';break;
		case 6:movie[6]='X';break;
		case 7:movie[7]='X';break;
		case 8:movie[8]='X';break;
		case 9:movie[9]='X';break;
		case 10:movie[10]='X';break;
		default:System.out.println("0~10의 숫자로 입력해주세요!!");
		}
*/		
		
		}
		
	}}
}
